export default function GoodsApi() {
    let _u = uni.$u
    return {
        // 收藏夹 查询
        queryFavoriteAll: (params: any) => {
            return _u.post('/goods/goodsReleaseMerchantFavorite/queryGoodsReleaseMerchantFavoriteAll', params)
        },
        // 是收藏该商品
        isCollect: (params: any) => {
            return _u.post('/goods/goodsReleaseMerchantFavorite/isCollect', params, {
                useJsonParam: true
            })
        },
        // 添加商品至我的收藏
        add2myFavorite: (params: any) => {
            return _u.post('/goods/goodsReleaseMerchantFavorite/saveGoodsReleaseMerchantFavorite', params, {
                useJsonParam: true
            })
        },
        //批量删除
        removeFavorites: (params: any) => {
            return _u.post('/goods/goodsReleaseMerchantFavorite/deleteGoodsReleaseMerchantFavorite', params)
        },
        // 根据条件查询商品列表
        queryGoodsReleasePage: (params: any) => {
            return _u.post('/goods/goods-release/app/queryGoodsReleasePage', params, {
                useMask: true
            })
        },
        // 根据商品id 查询详情
        queryGoodsReleaseInfo: (params: any) => {
            return _u.get('/goods/goods-release/app/queryGoodsReleaseInfo', params, {
                useJsonParam: true
            })
        },
        // 添加购物车
        addShoppingCart: (params: any) => {
            return _u.post('/goods/shopping_trolley_sku_detail/app/addShoppingTrolleySkuDetail', params, {
                useMask: true,
                useJsonParam: true
            })
        },
        // 购物车查询
        queryShoppingTrolleySkuDetail: (params: any) => {
            return _u.get('/goods/shopping_trolley_sku_detail/app/queryShoppingTrolleySkuDetailV3', params, {
                useMask: true,
                useJsonParam: true
            })
        },
        // 删除购物车内容
        delShoppingTrolleySkuDetail: (params: any) => {
            return _u.post('goods/shopping_trolley_sku_detail/app/delShoppingTrolleySkuDetail', params, {
                useJsonParam: true
            })
        },
        // 购物车 删除规格
        bathDelShoppingTrolleySkuDetail: (params: any) => {
            return _u.post('/goods/shopping_trolley_sku_detail/app/bathDelShoppingTrolleySkuDetail', params, {
                useMask: true,
                useJsonParam: true
            })
        },
        // 修改购物车规格数量 by 规格id
        updateShoppingTrolleySkuDetailBySkuId(params: any) {
            return _u.post('/goods/shopping_trolley_sku_detail/app/updateShoppingTrolleySkuDetailBySkuId', params, {
                useMask: true,
                useJsonParam: true
            })
        },
        //分享下载图片查询
        queryGoodsReleasePic: (id: string | number) => {
            return _u.get('/goods/goods-release/app/queryGoodsReleasePic', id, {
                useJsonParam: true
            })
        },
        // 推送图文至邮箱
        goodsReleasePicEmail: (params: any) => {
            return _u.post('/goods/goods-release/app/goodsReleasePicEmail', params, {
                useJsonParam: true
            })
        },
        // 卖家秀 图片分页查询
        queryAppSellerShowPicIdsPage(params: any) {
            return _u.post('/goods/goods-seller-show/queryAppSellerShowPicIdsPage', params)
        },
        // 卖家秀 视频查询
        queryAppSellerShowVideoIds(params: any) {
            return _u.get('/goods/goods-seller-show/queryAppSellerShowVideoIds', params, {
                useJsonParam: true
            })
        },
        // 卖家秀 水印模板查询
        queryTemplateList(params: any) {
            return _u.get('/merchant/merchant-seller-show-pic-template/queryTemplateList', params, {
                useJsonParam: true
            })
        },

        //记录足迹
        recordFootprint(params: any) {
            return _u.post('/goods/goods-footprint/recordFootprint', params, {
                useMask: true
            })
        },
        // 足迹查询
        queryFootprintListPage(params: any) {
            return _u.post('/goods/goods-footprint/queryFootprintListPage', params, {
                useMask: true
            })
        },
        // 删除足迹
        delFootprint(params: any) {
            return _u.post('/goods/goods-footprint/delFootprint', params, {
                useMask: true,
                useJsonParam: true
            })
        },
        // 商品 分类查询 用于商品搜索过滤
        querySaleLabelList: () => {
            return _u.get('/goods/goods-sale-label/app/querySaleLabelList')
        },
        // 系统表情库-分页查询
        groupPaging: (data: any) => {
            return _u.get('/base/system-facial/groupList', data)
        },
        // 保存或者新增模板
        saveConfig: (d: any) => {
            return _u.post('/merchant/merchant-seller-show-pic-template/addOrEdit', d, {
                useJsonParam: true
            })
        },
        // 删除配置模板
        delConfig: (d: any) => {
            return _u.post('/merchant/merchant-seller-show-pic-template/batchDelete', d)
        },
        // 修改购物车商品数量(通过sku列表)
        updateBySkuIds(params: any) {
            return _u.post('/goods/shopping_trolley_sku_detail/app/updateShoppingTrolleySkuDetailBySkuIds', params, {
                useJsonParam: true
            })
        },
        // 根据发布列表查询发布详情
        querySimpleGoodsReleaseInfoByIds(params: any) {
            return _u.get('/goods/goods-release/app/querySimpleGoodsReleaseInfoByIds', params)
        },
        // 通过商品发布id 和领型id  删除 购物车中的商品
        removeShoppingTrolleyByCollar(params: any) {
            return _u.post('/goods/shopping_trolley_sku_detail/app/removeShoppingTrolley', params)
        }
    }
}
